﻿using WebChatApi.Common.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace WebChatApi.Common
{
    /// <summary>
    /// Class for service response without any data involved. Use <see cref="ServiceResponse{T}"/> class if you want to involve data.
    /// Also see <seealso cref="ServiceResponse{T}"/> class.
    /// </summary>
    [DataContract(Name = "SimpleServiceResponse")]
    [KnownType(typeof(ServiceResponse<string>))]
    [KnownType(typeof(ExceptionInfo))]
    public class SimpleServiceResponse : ServiceResponse<string>
    {
        /// <summary>
        /// Forbidden property.
        /// Use <see cref="ServiceResponse{T}"/> class if you want to involve data.
        /// </summary>
        /// <value>
        /// Null.
        /// </value>
        public override string Data
        {
            get
            {
                return null;
            }
            set
            {
                //Do nothing.
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SimpleServiceResponse"/> class.
        /// Use <see cref="ServiceResponse{T}"/> class if you want to involve data.
        /// </summary>
        public SimpleServiceResponse()
            : base() { }
    }
}
